package pattern.singleton;

/**
 * 懒汉模式（线程不安全）
 * @author ytj
 * @date 2025/8/6
 */
public class Singleton2 {
    private static Singleton2 singleton=null;

    private Singleton2(){

    }

    public static Singleton2 getSingleton(){
        if(singleton==null){
            singleton=new Singleton2();
        }
        return singleton;
    }
}
